package com.david.springboot.controller;

import com.david.springboot.pojo.Article;
import com.david.springboot.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author David
 * @version V1.0
 * @Package com.david.springboot.controller
 * @date 2021/5/15 14:29
 */
@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;
    @Value("${david.apollo.test.show}")
    private String show;
    @RequestMapping("/{id}")
    public Article queryArticle(@PathVariable Integer id){
        System.out.println("show:"+show);
        return articleService.findById(id);
    }
}
